//
//  MainModuleAPI.m
//  Pods
//
//  Created by CoderSLZeng on 2017/11/22.
//

#import "MainModuleAPI.h"
#import "SLADViewController.h"
#import "SLNavigationBar.h"
#import "SLTabBar.h"
#import "SLTabBarController.h"
#import "Base.h"
#import "SLTopWindow.h"

@interface MainModuleAPI ()
    
@end

@implementation MainModuleAPI

+ (UIViewController *)rootViewController
{
    return [SLADViewController sharedADViewController];
}

+ (void)setupLaunchImageWithImageNamed:(NSString *)name
{
    SLADViewController.sharedADViewController.launchImageView.image = [UIImage imageNamed:name];
}

+ (void)showTopWindow
{
    [SLTopWindow.sharedTopWindow show];
}

+ (void)loadAdDataWithRequestURLString:(NSString *)string Parameters:(NSDictionary *)paramDict
{
    [SLADViewController.sharedADViewController loadAdDataWithRequestURLString:string Parameters:paramDict];
}

+ (void)loadAdDataWithParameters:(NSArray *)paramArr
{
    NSString *urlString = paramArr[0];
    NSMutableDictionary *dictM = paramArr[1];
    [self loadAdDataWithRequestURLString:urlString Parameters:dictM];
}
    
+ (void)setNavBarGlobalBackGroundImage: (UIImage *)globalImage
{
    [SLNavigationBar setNavBarGlobalBackGroundImage:globalImage];
}
    
+ (void)setNavBarGlobalTextColor:(UIColor *)globalTextColor andFontSize:(CGFloat)fontSize
{
    [SLNavigationBar setNavBarGlobalTextColor:globalTextColor andFontSize:fontSize];
}

+ (void)addChildVC:(UIViewController *)vc title:(NSString *)title  normalImageName:(NSString *)normalImageName selectedImageName:(NSString *)selectedImageName isRequiredNavController:(BOOL)isRequired
{
    [[SLTabBarController sharedTabBarController] addChildVC:vc title:title normalImageName:normalImageName selectedImageName:selectedImageName isRequiredNavController:isRequired];
}

+ (void)addChildVCWithParameters:(NSArray *)paramArr
{
    UIViewController *vc = paramArr[0];
    NSString *title = paramArr[1];
    NSString *normalImageName = paramArr[2];
    NSString *selectedImageName = paramArr[3];
    BOOL isRequired = [paramArr[4] boolValue];
    [self addChildVC:vc title:title normalImageName:normalImageName selectedImageName:selectedImageName isRequiredNavController:isRequired];
}
    
+ (void)setTabbarMiddleBtnClick:(void(^)(void))middleClickBlock
{
    SLTabBar *tabBar =(SLTabBar *)[SLTabBarController sharedTabBarController].tabBar;
    tabBar.middleClickBlock = middleClickBlock;
}

@end
